<html>
<head><meta charset="utf-8"><title>x.py doc errors · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html">x.py doc errors</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="227022361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227022361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227022361">(Feb 19 2021 at 20:19)</a>:</h4>
<p>Running <code>./x.py doc compiler/rustc --stage 0</code> with unrelated changes produces a bunch of errors like this:</p>
<div class="codehilite"><pre><span></span><code>error[E0308]: mismatched types
    --&gt; /Users/user/rust3/compiler/rustc_data_structures/src/macros.rs:5:32
     |
3    | / macro_rules! static_assert_size {
4    | |     ($ty:ty, $size:expr) =&gt; {
5    | |         const _: [(); $size] = [(); ::std::mem::size_of::&lt;$ty&gt;()];
     | |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `72_usize`, found `::std::mem::size_of::&lt;$ty&gt;()`
6    | |     };
7    | | }
     | |_- in this expansion of `rustc_data_structures::static_assert_size!`
     |
    ::: compiler/rustc_hir/src/hir.rs:2981:5
     |
2981 |       rustc_data_structures::static_assert_size!(super::Ty&lt;&#39;static&gt;, 72);
     |       ------------------------------------------------------------------- in this macro invocation
     |
     = note: expected array `[(); 72]`
                found array `[(); _]`
</code></pre></div>
<p>Is this a known issue with that invocation of <code>x.py doc</code>?</p>



<a name="227022506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227022506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227022506">(Feb 19 2021 at 20:20)</a>:</h4>
<p>Also getting these warnings with plain <code>./x.py doc</code>:</p>
<div class="codehilite"><pre><span></span><code>[2021-02-19T20:18:53Z WARN  mdbook::renderer::html_handlebars::hbs_renderer] Previous versions of mdBook erroneously accepted `./src/theme` as an automatic theme directory
[2021-02-19T20:18:53Z WARN  mdbook::renderer::html_handlebars::hbs_renderer] Please move your theme files to `./theme` for them to continue being used
Rustbook (x86_64-apple-darwin) - book/second-edition
[2021-02-19T20:18:53Z WARN  mdbook::renderer::html_handlebars::hbs_renderer] Previous versions of mdBook erroneously accepted `./src/theme` as an automatic theme directory
[2021-02-19T20:18:53Z WARN  mdbook::renderer::html_handlebars::hbs_renderer] Please move your theme files to `./theme` for them to continue being used
Rustbook (x86_64-apple-darwin) - book/2018-edition
[2021-02-19T20:18:54Z WARN  mdbook::renderer::html_handlebars::hbs_renderer] Previous versions of mdBook erroneously accepted `./src/theme` as an automatic theme directory
[2021-02-19T20:18:54Z WARN  mdbook::renderer::html_handlebars::hbs_renderer] Please move your theme files to `./theme` for them to continue being used
</code></pre></div>



<a name="227023669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227023669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227023669">(Feb 19 2021 at 20:30)</a>:</h4>
<p>Actually I got the same bunch of errors with plain <code>x.py doc</code>.</p>



<a name="227023726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227023726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227023726">(Feb 19 2021 at 20:30)</a>:</h4>
<p>This is weird...</p>



<a name="227025864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227025864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227025864">(Feb 19 2021 at 20:47)</a>:</h4>
<p>I think it should be expected that building the compiler docs with stage 0 might fail.  Try stage 1.</p>
<p>The warnings about mdbook have been there for a long time.  Someone just needs to update the book on where the theme directory is located.</p>



<a name="227030572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227030572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227030572">(Feb 19 2021 at 21:22)</a>:</h4>
<p><span class="user-mention silent" data-user-id="307537">Camelid</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/x.2Epy.20doc.20errors/near/227022361">said</a>:</p>
<blockquote>
<p>Running <code>./x.py doc compiler/rustc --stage 0</code> with unrelated changes produces a bunch of errors like this:</p>
<div class="codehilite"><pre><span></span><code>error[E0308]: mismatched types
    --&gt; /Users/user/rust3/compiler/rustc_data_structures/src/macros.rs:5:32
     |
3    | / macro_rules! static_assert_size {
4    | |     ($ty:ty, $size:expr) =&gt; {
5    | |         const _: [(); $size] = [(); ::std::mem::size_of::&lt;$ty&gt;()];
     | |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `72_usize`, found `::std::mem::size_of::&lt;$ty&gt;()`
6    | |     };
7    | | }
     | |_- in this expansion of `rustc_data_structures::static_assert_size!`
     |
    ::: compiler/rustc_hir/src/hir.rs:2981:5
     |
2981 |       rustc_data_structures::static_assert_size!(super::Ty&lt;&#39;static&gt;, 72);
     |       ------------------------------------------------------------------- in this macro invocation
     |
     = note: expected array `[(); 72]`
                found array `[(); _]`
</code></pre></div>
<p>Is this a known issue with that invocation of <code>x.py doc</code>?</p>
</blockquote>
<p>that particular error is weird, but in general doc --stage 0 doesn't work, no: <a href="https://github.com/rust-lang/rust/issues/74976">https://github.com/rust-lang/rust/issues/74976</a></p>



<a name="227031398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227031398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227031398">(Feb 19 2021 at 21:30)</a>:</h4>
<p>But even <code>x.py doc</code> without <code>--stage 0 compiler/rustc</code> gave the same errors. Do I need to <code>x.py clean</code>?</p>



<a name="227031430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227031430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227031430">(Feb 19 2021 at 21:30)</a>:</h4>
<p>oh huh, I'm not sure then</p>



<a name="227031532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227031532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227031532">(Feb 19 2021 at 21:31)</a>:</h4>
<p>it works in <em>some</em> configuration because that's how the nightly-rustc docs are published</p>



<a name="227032023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227032023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227032023">(Feb 19 2021 at 21:35)</a>:</h4>
<p>Yeah, I know I've done it before :/</p>



<a name="227032074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227032074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227032074">(Feb 19 2021 at 21:36)</a>:</h4>
<p>I'll just clean and retry without the args</p>



<a name="227033781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227033781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227033781">(Feb 19 2021 at 21:51)</a>:</h4>
<p>I cleaned and re-ran, but I got the same errors :/</p>



<a name="227033799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227033799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227033799">(Feb 19 2021 at 21:51)</a>:</h4>
<p>Maybe I need to rebase?</p>



<a name="227033865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227033865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227033865">(Feb 19 2021 at 21:52)</a>:</h4>
<p>I ran <code>./x.py doc</code> and then cancelled it partway through to add <code>-j2</code>, so I hope that wasn't the issue. But seems unlikely to cause this to happen.</p>



<a name="227035543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227035543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227035543">(Feb 19 2021 at 22:03)</a>:</h4>
<p><span class="user-mention" data-user-id="307537">@Camelid</span> The default for <code>x.py doc</code> is <code>--stage=0</code></p>



<a name="227035676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227035676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227035676">(Feb 19 2021 at 22:03)</a>:</h4>
<p>I think I thought it was smart enough to use <code>--stage 1</code> for the compiler docs.</p>



<a name="227035686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227035686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227035686">(Feb 19 2021 at 22:03)</a>:</h4>
<p>Thanks!</p>



<a name="227035728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227035728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227035728">(Feb 19 2021 at 22:03)</a>:</h4>
<p>I bet it's related to the const-generics stabilization.</p>



<a name="227036070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227036070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227036070">(Feb 19 2021 at 22:05)</a>:</h4>
<p>Hmm, I got the errors again with <code>./x.py doc --stage=1 -j2</code>. Do I need to <code>x.py clean</code> again?</p>



<a name="227036641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227036641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227036641">(Feb 19 2021 at 22:08)</a>:</h4>
<p>--stage 0 and --stage 1 always use different caches, so cleaning won't help</p>



<a name="227036888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227036888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227036888">(Feb 19 2021 at 22:09)</a>:</h4>
<p>My merge-base is recent (I think from yesterday), but I guess I'll try rebasing.</p>



<a name="227039152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227039152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227039152">(Feb 19 2021 at 22:23)</a>:</h4>
<p>I rebased and ran <code>./x.py doc --stage=1 -j2</code> again, and I got the same set of 23 errors. Anyone have ideas?</p>



<a name="227039432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/227039432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#227039432">(Feb 19 2021 at 22:25)</a>:</h4>
<p>The only change I've made is to the lang item table macro.</p>



<a name="228152097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/228152097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#228152097">(Feb 28 2021 at 19:47)</a>:</h4>
<p>Opened a PR to see if CI passes: <a href="https://github.com/rust-lang/rust/issues/82641">#82641</a></p>



<a name="228152299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/x.py%20doc%20errors/near/228152299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/x.2Epy.20doc.20errors.html#228152299">(Feb 28 2021 at 19:50)</a>:</h4>
<p>CI failed. The errors were caused by a single syntax error that threw off the compiler <span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span> </p>
<div class="codehilite"><pre><span></span><code>error: no rules expected the token `#`
   --&gt; compiler/rustc_hir/src/lang_items.rs:49:21
    |
39  | / macro_rules! language_item_table {
40  | |     (
41  | |         $( $variant:ident $($group:expr)?, $name:expr, $method:ident, $target:expr; )*
42  | |     ) =&gt; {
...   |
49  | |                     #[doc = concat!(&quot;The `&quot;, stringify!($name), &quot;` lang item.&quot;)]
    | |                     ^ no rules expected this token in macro call
...   |
134 | |     }
135 | | }
    | |_- in this expansion of `language_item_table!`
...
165 | / language_item_table! {
166 | | //  Variant name,            Name,                     Method name,                Target;
167 | |     Bool,                    sym::bool,                bool_impl,                  Target::Impl;
168 | |     Char,                    sym::char,                char_impl,                  Target::Impl;
...   |
343 | |     RangeTo,                 sym::RangeTo,             range_to_struct,            Target::Struct;
344 | | }
    | |_- in this macro invocation
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>